<?php
	require_once($_SERVER['DOCUMENT_ROOT']."/classes/Account.class.php");
	require_once($_SERVER['DOCUMENT_ROOT']."/classes/Member.class.php");
	require_once($_SERVER['DOCUMENT_ROOT']."/includes/sugar.php");
	session_start();

$array['content'] = '<div id="'.$_POST['id'].'" class="leftFloat memberSummary edited">
    <form action="" method="post">
            <input type="text" id="nickname" value="'.$_SESSION['account']->members[$_POST['id']]->nickname.'" placeholder="Pseudonyme" /><br/>
            <input type="text" id="birthDate" placeholder="Date de naissance (JJ/MM/AAAA)" value="'.$_SESSION['account']->members[$_POST['id']]->birthDate.'"/><br/>
            <select id="gender">
                <option value="1" '.(($_SESSION['account']->members[$_POST['id']]->gender == 1)? "selected":"").'>Homme</option>
                <option value="2" '.(($_SESSION['account']->members[$_POST['id']]->gender == 2)? "selected":"").'>Femme</option>
            </select><br/>
            <label for="savingResults">Sauvegarder les résultats ?</label><input type="checkbox" id="savingResults" value="1" '.(($_SESSION['account']->members[$_POST['id']]->savingResults == 1)? "checked":"").'/><br/>
            <input type="button" value="Modifier" id="newMemberButton" onClick="ajaxLoad(\'editMember\',\'memberId='.$_POST['id'].'&\'+makeData(\'nickname\')+\'&\'+makeData(\'birthDate\')+\'&\'+makeData(\'gender\')+\'&\'+makeCheckboxData(\'savingResults\'),editMember_response)" />
		</span>
    </form>
</div>';
$array['id'] = $_POST['id'];
echo json_encode($array);